package com.game.majiang.vo;

import java.sql.Types;


import lombok.Getter;
import lombok.Setter;

import com.game.server.db.Parameter;
import com.game.server.db.ParameterType;
import com.game.server.db.SqlHelper;
import com.game.server.db.SqlHelperwrite;
@Setter
@Getter
public class ProxyToExamineVo {

	String name;//真实姓名
	String weixinhao;//
	String chalouname;
	String applydescription;//说明
	String phone;
	int uid;
	int pid;
	int currentDiamonds;
	int currentIntegral;
	int servicecharge;
	public void insert(){
		String cmdText = "INSERT INTO proxytoexamine_log (uid,clientname,weixinhao,chalouname,applydescription,phone,servicecharge) VALUES(?,?,?,?,?,?,?)";
		Parameter p1 = new Parameter(Types.INTEGER,uid,ParameterType.Input);
		Parameter p2 = new Parameter(Types.VARCHAR, name,ParameterType.Input);
		Parameter p3 = new Parameter(Types.VARCHAR, weixinhao,ParameterType.Input);
		Parameter p4 = new Parameter(Types.VARCHAR, chalouname,ParameterType.Input);
		Parameter p5 = new Parameter(Types.VARCHAR, applydescription,ParameterType.Input);
		Parameter p6 = new Parameter(Types.VARCHAR, phone,ParameterType.Input);
		Parameter p7 = new Parameter(Types.INTEGER, servicecharge,ParameterType.Input);
		SqlHelperwrite.execute(cmdText, p1,p2,p3,p4,p5,p6,p7);
	}
	//查讯是否有申请还未审核 id
	public boolean checkApplyUid(int id){
		String cmdText = "SELECT id FROM proxytoexamine_log WHERE uid = ? AND state<>2;";
		Parameter p1 = new Parameter(Types.INTEGER,id,ParameterType.Input);
		Object obj =SqlHelper.execScalar(cmdText, p1);
		if(obj!=null){
			return (int)obj>0;
		}
		return false;
	}
	public boolean checkApplyPhone(String ph){
		String cmdText = "SELECT id FROM proxytoexamine_log WHERE phone = ? AND state<>2;";
		Parameter p1 = new Parameter(Types.VARCHAR, ph,ParameterType.Input);
		Object obj =SqlHelper.execScalar(cmdText, p1);
		if(obj!=null){
			return (int)obj>0;
		}
		return false;
	}
	
	
	
}
